home *** CD-ROM | disk | FTP | other *** search
- #include <iostream.h>
- #include <fstream.h>
- #include <stdio.h>
- #include <osfcn.h>
- #include <libc.h>
-
- #include "RJS/Transport.h"
-
- static char buffer [512000];
-
- void test(char *the_file)
- {
-
- RJS_DECnetSeqPacket server,client; // create server
- RJS_DECnetAddress object(140);
-
- // object.dump();
- // cout << object.ss_message() << endl;
-
- fstream bin_file(the_file,ios::in);
- bin_file.read(buffer,512000);
- int size=bin_file.gcount();
- cout << "server writing ==> " << size << endl;
- server.passive(object);
- server.linger();
- server.accept(client); // accept a client
-
- client.linger();
- client.write(buffer,size); // write to client
- sleep(5);
-
- }
-
-
- int main(int argc, char *argv[])
- {
- test(argv[1]);
- exit(0);
- }
-